<?php

class QuickSearch extends CWidget {
	
	const ITEM_TICKET = 'Ticket';
	const ITEM_SCENIC = 'CompanyScenic';
	const ITEM_HOTEL = 'CompanyHotel';
	
	public $hotelTitle = '酒店';
	public $scenicTitle = '景区';
	public $ticketTitle = '机票';
	
	public $items = array(
		self::ITEM_HOTEL, 
		self::ITEM_SCENIC, 
		self::ITEM_TICKET
	);
	
	public function run() {
		
		$ticket = $companyHotel = $companyScenic = null;
		foreach($this->items as $item) {
			$var = lcfirst($item);
			$$var = new $item('search');
		}
		
		$this->render('application.views.partials.platform.quickSearch', array(
			'ticket' => $ticket,
			'hotel' => $companyHotel,
			'scenic' => $companyScenic,
			'hotelTitle' => $this->hotelTitle,
			'scenicTitle' => $this->scenicTitle,
			'ticketTitle' => $this->ticketTitle,
		));
		
	}

}

?>